import { CheckCircleFilled, CheckCircleOutlined, ClockCircleOutlined, SyncOutlined } from "@ant-design/icons";
import { Tag } from "antd";

const renderFlagFn = (flag: string, index: number) => {
  //0 提交 冲提交 1 当前审批人 2 未审批  3 已审批
  switch (flag) {
    case "0":// 提交 重提交
      return <Tag icon={<CheckCircleOutlined />} color="green">{index == 0 ? '开始流程' : '审批完'}</Tag>;
    case "1"://    审批中
      return <Tag icon={<SyncOutlined spin />} color="processing">审批中</Tag>;
    case "2"://   未审批
      return <Tag icon={<ClockCircleOutlined />}>未审批</Tag>;
    case "3"://  已审批
      return <Tag icon={<CheckCircleOutlined />} color="green">已审批</Tag>;
    default:
      return "";
  }
};

const badgeItem = {
  '0': <CheckCircleFilled style={{ color: '#52c41a', fontSize: 14 }} />,
  '1': <SyncOutlined spin style={{ color: '#1890ff', fontSize: 14 }} />,
  '2': <ClockCircleOutlined style={{ color: '#eee', fontSize: 14 }} />,
  '3': <CheckCircleFilled style={{ color: '#52c41a', fontSize: 14 }} />,
}

export {
  renderFlagFn,
  badgeItem
}
